USE SSB
GO

--get transport certificate
CREATE MASTER KEY ENCRYPTION BY PASSWORD = N'ssbrouter';
GO
CREATE USER Web001Dbo  WITHOUT LOGIN;
GO
--Creating certificate which will be used for encrypting messages. 
-- select * from sys.certificates;
CREATE CERTIFICATE DlgCert_Web001 
       AUTHORIZATION Web001Dbo
       WITH SUBJECT = 'Certificate For Web001 database',
       START_DATE = N'1/1/2012',
       EXPIRY_DATE = N'1/1/2022';
GO

--backup transport certificate
BACKUP CERTIFICATE DlgCert_Web001
TO FILE = 'D:\SSBCertificates\DlgCert_Web001.cer'
GO

--create ssbroute's certificate
CREATE USER SSBRouterDbo WITHOUT LOGIN

CREATE CERTIFICATE DlgCert_SSBRouter
	AUTHORIZATION SSBRouterDbo
    FROM FILE = 'D:\SSBCertificates\DlgCert_SSBRouter.cer'
GO